package com.tanhua.server.service;

import com.tanhua.dubbo.api.UserLocationApi;
import com.tanhua.server.intercepror.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {

    @DubboReference
    private UserLocationApi userLocationApi;

    /**
     * 上传地理位置信息
     * @param lat
     * @param lon
     * @param address
     */
    public void location(Double lat, Double lon, String address) {
        //1、获取用户id
        Long userId = UserHolder.getUserId();
        //2、调用api保存
        userLocationApi.save(userId,lat,lon,address);
    }
}
